//Erstellt von Moritz Liepe
package main.simulation;

import main.Module;

import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;


public class SetModulePosition implements Runnable {

	private Module module;
	private Point point;
	
	public SetModulePosition(Module m, Point p)
	{
		super();
		this.module = m;
		this.point = p;
	}
	
	@Override
	public void run() 
	{
		this.module.setLocation(point);
		this.module.getParent().getLayoutManager().setConstraint(this.module, new Rectangle(point.x-((Figure)this.module.getParent()).getLocation().x, point.y-((Figure)this.module.getParent()).getLocation().y, this.module.getWidth(), this.module.getHeight()));
	}

}
